package yxy.game.pm2.bean.pubsub;

import yxy.apple.util.PubSub.ISubscription;
import yxy.apple.util.PubSub.Publisher;
import yxy.game.pm2.bean.PlayerBean;

/** 角色数据发布者 */
public class PlayerBeanPublisher extends Publisher {
	static private PlayerBeanPublisher instance;

	public static PlayerBeanPublisher getInstance() {
		if (instance == null) {
			instance = new PlayerBeanPublisher();
		}
		return instance;
	}

	private PlayerBeanPublisher() {

	}

	public void publish(PlayerBean playerBean) {
		this.publish(new PlayerBeanSubscription(playerBean));
	}

	public static class PlayerBeanSubscription implements ISubscription {
		private PlayerBean playerBean;

		public PlayerBeanSubscription(PlayerBean playerBean) {
			this.playerBean = playerBean;
		}

		public PlayerBean getPlayerBean() {
			return playerBean;
		}
	}
}
